package com.well.register.event;

import com.well.register.data.DataCenter;
import com.well.rpc.model.EventType;
import com.well.rpc.model.TransData;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class HeartBeatEvent implements AppEvent {
    @Override
    public void doEvent(ChannelHandlerContext channelHandlerContext, TransData transData) {
        if (DataCenter.getEnableHeatBeat()) {
            log.info(transData.getJsonData());
        }
    }

    @Override
    public EventType eventType() {
        return EventType.HEARTBEAT;
    }
}
